package com.zan.pattern.mediator;

/**
 * @Author Zan
 * @Create 2024/4/27 16:12
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Client
 */
public class Client {
    public static void main(String[] args) {
        // 创建中介者对象
        MediatorStructure mediatorStructure = new MediatorStructure();

        // 创建租房者对象
        Tenant tenant = new Tenant("李四", mediatorStructure);
        // 创建房东对象
        HouseOwner houseOwner = new HouseOwner("张三", mediatorStructure);

        // 中介者要知道具体的房东和租房者
        mediatorStructure.setTenant(tenant);
        mediatorStructure.setHouseOwner(houseOwner);

        tenant.constact("我要租三室的房子！！！");
        houseOwner.constact("我这里有三室的房子，你要租吗？");
    }
}
